var sending = false;

$(document).ready(function(){
    $(".common_errors_container").width($(".form_container_center").outerWidth() - 2);

    var validateParams = {
        rules:
        {
            name: "required",
            email: {
                required: true,
                email: true
            },
            message: "required",
            captcha: "required"
        },

        messages:
        {
            name:    "<strong>Name: </strong>Please enter your name" ,
            email:   "<strong>Email: </strong>Please enter existing e-mail address",
            message: "<strong>Message: </strong>Please enter a message",
            captcha: "<strong>Private Key: </strong>Please enter a private key"
        },

        submitHandler: function(form) {
            form.submit();
        }
    };

    var feedbackFormValidatorSettings = generateSettings( validateParams );

    $('#feedback_form').submit(function(){
        $(this).unbind()
               .validate( feedbackFormValidatorSettings );
        return $(this).valid();
    });

    $("#button_send").bind("click", function(){
        sending = true;
    });
});